/**
 * GUI - Settings
 * @author Mikkel Christiansen
 */

package com.kea.firsthorse.client;

import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.user.client.ui.HTML;
import com.kea.firsthorse.shared.User;
import com.sksamuel.jqm4gwt.button.JQMButton;
import com.sksamuel.jqm4gwt.form.elements.JQMPassword;
import com.sksamuel.jqm4gwt.form.elements.JQMText;

public class GUI_Settings extends GUI_Master implements ClickHandler {

	private JQMPassword txtPass;
	private JQMPassword txtPassAgain;
	private JQMText txtAdresse;
	private JQMText txtPostnr;
	private JQMText txtBy;
	private JQMText txtLand;
	private JQMText txtFirmanavn;
	private JQMText txtCvr;
	private JQMText txtTelefon;
	private JQMText txtLokal;
	private JQMText txtFax;
	private JQMText txtEmail;
	private JQMButton btnSave;

	public GUI_Settings(User user) {

		super();

		add(new HTML("<h1>Indstillinger</h1>"));

		txtPass = new JQMPassword();
		txtPass.setText("Nyt password");
		add(txtPass);

		txtPassAgain = new JQMPassword();
		txtPassAgain.setText("Nyt password igen");
		add(txtPassAgain);

		txtAdresse = new JQMText();
		txtAdresse.setText("Adresse");
		txtAdresse.setValue(user.getAdresse());
		add(txtAdresse);

		txtPostnr = new JQMText();
		txtPostnr.setText("Postnummer");
		txtPostnr.setValue("" + user.getPostnr());
		add(txtPostnr);

		txtBy = new JQMText();
		txtBy.setText("By");
		txtBy.setValue(user.getBy());
		add(txtBy);

		txtLand = new JQMText();
		txtLand.setText("Land");
		txtLand.setValue(user.getLand());
		add(txtLand);

		txtFirmanavn = new JQMText();
		txtFirmanavn.setText("Firmanavn");
		txtFirmanavn.setValue(user.getFirmanavn());
		add(txtFirmanavn);

		txtCvr = new JQMText();
		txtCvr.setText("CVR");
		txtCvr.setValue("" + user.getCvr());
		add(txtCvr);

		txtTelefon = new JQMText();
		txtTelefon.setText("Telefonnummer");
		txtTelefon.setValue(user.getTelefon());
		add(txtTelefon);

		txtLokal = new JQMText();
		txtLokal.setText("Lokalnummer");
		txtLokal.setValue(user.getLokal());
		add(txtLokal);

		txtFax = new JQMText();
		txtFax.setText("Fax");
		txtFax.setValue(user.getFax());
		add(txtFax);

		txtEmail = new JQMText();
		txtEmail.setText("Email");
		txtEmail.setValue(user.getEmail());
		add(txtEmail);

		btnSave = new JQMButton("Gem oplysninger");
		btnSave.addClickHandler(this);
		add(btnSave);

	}

	@Override
	public void onClick(ClickEvent e) {
		if (e.getSource().equals(btnSave)) {
			// Når man klikker på save.
		}
	}

}
